<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>课程信息添加</title>
        <script type="text/javascript">
		    function check(){
		    	if(addform.courseno.value==""){
		    		alert("课程号不能为空!");
		    		addform.courseno.focus();
		    		return false;
		   	 }
		    if(addform.coursename.value==""){
		    		alert("课程名不能为空!");
		    		addform.coursename.focus();
		    		return false;
		    }
		    if(addform.credit.value==""){
			    alert("学分不能为空!");
			    addform.credit.focus();
			    return false;
			 }
              if(addform.teano.value==""){
			    alert("教师编号不能为空!");
			    addform.teano.focus();
			    return false;
			 }
			if(isNaN(parseInt(addform.courseno.value))){
			    alert("课程号必须为数字!");
			    addform.courseno.focus();
    			return false;
    		}
			    if(isNaN(parseInt(addform.teano.value))){
			    alert("教师编号必须为数字!");
			    addform.teano.focus();
			    return false;
			    }
			    addform.submit();
			}
    </script>
    
    </head>
    <body bgcolor="CCCFFF">
        <center>
            <br><br><br>
            <h3>&nbsp;&nbsp;添加课程信息</h3>
            <form action= "counoValidate.jsp"  method="post" name="addform">
                <table border="0" width="500">
                    <tr>
                        <td>课程号</td>
                        <td><input type="text" name="courseno"></td>
                    </tr>
                    <tr>
                        <td>课程名</td>
                        <td><input type="text" name="coursename"></td>
                    </tr>
                    <tr>
                        <td>学分</td>
                        <td><input type="text" name="credit"></td>
                    </tr>
                    <tr>
                        <td>教师号</td>
                        <td><input type="text" name="teano" ></td>
                    </tr>
                    <tr align="center">
                        <td colspan="2">
                            <input name="sure" type="button" value="提  交" onClick="check()">
                            &nbsp;&nbsp;&nbsp;&nbsp;
                            <input name="clear" type="reset" value="取  消">
                        </td>
                    </tr>
                </table>
            </form>
        </center>
    </body>
</html>